/**
 *
 * @author JOKE
 * Card
 */

package NinetyNine;

import java.io.Serializable;

public class Card implements Serializable {
    private int value; // 1-13
    private int suit;
    // value of suit:
    //1 for Club;
    //2 for Diamonds;
    //3 for Heart;
    //4 for Spade;
    public Card(int value, int suit ) {
        this.value=value;
        this.suit=suit;
    }

    public int getValue()
    {   
        return value;
    }
    public int getSuit()
    {
        return suit;
    }
    public boolean isValid() {
        if(this.suit < 1 || this.suit > 4 || this.value < 1 || this.value > 13)
            return false;
        return true;
    }

    @Override
    public String toString() {
        return Integer.toString(this.getValue());
    }

    public boolean equalTo(Card compare) {
        if(this.suit==compare.suit && this.value==compare.value)
            return true;
        else
            return false;
    }
}
